Override our lovely, platform independent build with alots of "if darwin"
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 9 Apr 2006 19:10:59 +0000 (19:10 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 9 Apr 2006 19:10:59 +0000 (19:10 +0000)
tests to staticly link expat and libusb so Mac users don't have to fink those
packages.  Sigh.

gpsbabel/configure.in

index f2ae19c11e4ba27b9f9f75bd409c98ebb3807dbc..db8274bfb47dd9d2077ceebe11e6f59d91e3d333 100644 (file)
@@ -52,11 +52,19 @@ case "$target" in
                        [USB_LIBS="`libusb-config --libs`"],
                        [AC_MSG_ERROR([libusb >= 0.1.8 is needed])]
                        )
+               # Override libusb for Darwin to reduce external 
+               # runtime requirement.
+               case "$target" in
+               *-*-darwin*)
+                 if test "x$ac_cv_lib_usb_usb_interrupt_read" = "xyes" ; then
+                       USB_LIBS="`libusb-config --prefix`/lib/libusb.a -framework  IOKit -framework CoreFoundation"
+                 fi
+               esac
                OSJEEPS=jeeps/gpslibusb.o
                CFLAGS="$OCFLAGS"
        #       LIBS="$LIBS `libusb-config --libs`"
        fi
-    ;;
+       ;;
 esac
 
 AC_SUBST(USB_LIBS)
@@ -72,16 +80,23 @@ if test "$with_libexpat" = no ; then
 else
 
 # Special case fink test.
-       if test -f /sw/include/expat.h; then
-               CFLAGS="$CFLAGS -I/sw/include"
-       fi
-       if test -f /sw/include/expat.h; then
-               LDFLAGS="$LDFLAGS -L/sw/lib"
-       fi
-
-       AC_CHECK_LIB([expat], [XML_ParserCreate], 
-               AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
-               [EXPAT_LIB="$LDFLAGS -lexpat"])
+       case "$target" in
+       *-*-darwin*)
+               if test -f /sw/include/expat.h -a -f /sw/include/expat.h; then
+                       CFLAGS="$CFLAGS -I/sw/include"
+                       LDFLAGS="$LDFLAGS -L/sw/lib"
+                       # Static link against expat archive, not dyn lib.
+                       AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
+                       EXPAT_LIB=/sw/lib/libexpat.a
+               fi
+               ;;
+       *)
+               AC_CHECK_LIB([expat], [XML_ParserCreate], 
+                       AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
+                       [EXPAT_LIB="$LDFLAGS -lexpat"])
+
+               ;;
+       esac
 fi
 AC_SUBST(EXPAT_LIB)